package com.yuanfengPlus.inventory.service.impl;


import com.yuanfengPlus.inventory.dao.IInventoryChangeDao;
import com.yuanfengPlus.inventory.entity.InventoryChange;
import com.yuanfengPlus.inventory.service.IInventoryChangeService;
import com.yuanfengPlus.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class InventoryChangeServiceImpl implements IInventoryChangeService {
    @Autowired
    private IInventoryChangeDao iicd;
    //根据不同条件查询库存变动记录
    @Override
    public Result<List<InventoryChange>> queryInventoryChangeService(Map<String, Object> params) {
        List<InventoryChange> inventoryChanges = iicd.queryInventoryChange(params);
        if (!inventoryChanges.isEmpty()) {
            return Result.success(inventoryChanges);
        }
        return Result.failure(400, "暂无数据");
    }
}
